
// navbar
function navbar(navbarname){
    let arr =[
        {
            title:'跑步',
            path:'./run.html',
        },
        {
            title:'骑行',
            path:'./ride.html',
        },
        {
            title:'课程训练',
            path:'./course.html'
        },
    ]

    // 模板
    let html =`
        ${arr.map(function(v){
            // 
            return `
            <a href="${v.path}" class="${v.path === `./${navbarname}.html` && 'active'}">${v.title}</a>
            `
        })
        .join('')
     }
    `
    const div = document.createElement('div')
    div.className='navbarUl df jcsa aic'
    div.innerHTML = html
    document.body.prepend(div)
}
        //导出渲染函数
        module.exports = navbar
